#include <iostream>
#include <netpp/tcpstream>
#include <netpp/except>

int
main(int argc, char **argv)
{
    using namespace std;
    using namespace netpp;

    string get, host, put;
    int port;

    host = "www.google.com";
    port = 80;
    put= "GET /pda HTTP/1.0\r\nHost:" +host+"\r\nAccept: text/html, text/plain, text/css, text/sgml, */*;q=0.01\r\nAccept-Language: en\r\nUser-Agent: hl7libpp v0.3r26\r\n\r\n";


    try
    {
        tcpclient s(host, port);
        s << put;
        s >> get;

        cout << get << endl;
        
    }
    catch(Exception &e)
    {
        cout << e.what() << endl;
        return EXIT_FAILURE;
    }

    return EXIT_SUCCESS;
}
